package xyz.yuzegod.megawalls.command;

import org.bukkit.command.CommandException;
import org.bukkit.command.CommandSender;
import xyz.yuzegod.megawalls.MegaWalls;
import xyz.yuzegod.megawalls.game.Game;

public class CommandForceStart extends BaseCommand
{
    public CommandForceStart() {
        super("forcestart");
        this.setPermission("MegaWalls.forcestart");
    }
    
    @Override
    public String getPossibleArguments() {
        return "";
    }
    
    @Override
    public int getMinimumArguments() {
        return 0;
    }
    
    @Override
    public void execute(final CommandSender sender, final String label, final String[] args) throws CommandException {
        final Game game = MegaWalls.getInstance().getGame();
        if (game == null) {
            sender.sendMessage("§c§l未获取到游戏对象,无法强制开启游戏！");
            return;
        }
        game.forceStart();
    }
    
    @Override
    public boolean isOnlyPlayerExecutable() {
        return false;
    }
}
